package com.sohoometer.web;

import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.net.HttpURLConnection;
import java.net.InetAddress;
import java.net.Socket;
import java.net.URL;

import org.apache.commons.io.IOUtils;

public class WebPost {
public static void main(String[] args) throws Exception, IOException {
	InputStream resourceAsStream = WebPost.class.getResourceAsStream("test");
//	
//	URL url = new URL("");
//	InputStream openStream = url.openStream();
	String host = "http://www.educity.cn/shipin/ws_play.asmx";
	HttpURLConnection urlConnection = (HttpURLConnection) new URL(host).openConnection();
	urlConnection.setDoOutput(true);
	OutputStream outputStream2 = urlConnection.getOutputStream();
	IOUtils.copy(resourceAsStream, outputStream2);
	InputStream inputStream = urlConnection.getInputStream();
	String string = IOUtils.toString(inputStream);
System.out.println(string);	
//	Socket socket = new Socket(InetAddress.getByName(host), 80);
//	OutputStream outputStream = socket.getOutputStream();
	
	
}	
	
	
	
}
